i, j=1, 2
sum=0
while j<4000000:
    if j%2==0:
        sum+=j
    i, j=j, i+j
print sum

